//
//  Material_detial_Cell.m
//  Food
//
//  Created by dllo on 15/7/18.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Material_detial_Cell.h"
#import "BaseHeader.h"
#import "UIImageView+WebCache.h"
@implementation Material_detial_Cell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.image = [[UIImageView alloc] init];
        [self.contentView addSubview:self.image];
        
        self.lable = [[UILabel alloc] init];
        [self.image addSubview:self.lable];
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.image.frame = CGRectMake(20, 0, ScreenWidth - 40, 150);
    self.lable.frame = CGRectMake(10, 10, 100, 20);
}

- (void)setModel:(Materials_Model *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    [self.image sd_setImageWithURL:[NSURL URLWithString:model.imagePath]];
    self.lable.text = model.name;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
